package com.huawei.esdk.tp.authorize;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SessionInfo
{
    private String smcSessionId;

    private String userName;
    
    private Map<String, String> terminalSessions = new HashMap<String, String>();
    
    private List<String> terminalUriList = new ArrayList<String>();

    private String randomSequence;
    
    private boolean isLogged;
    
    private byte[] secretKey;
    
    private byte[] iv;

    public boolean isLogged()
    {
        return isLogged;
    }

    public void setLogged(boolean isLogged)
    {
        this.isLogged = isLogged;
    }

    public String getSMCSessionId()
    {
        return smcSessionId;
    }

    public void setSMCSessionId(String srcSessionId)
    {
        smcSessionId = srcSessionId;
    }

    public String getUserName()
    {
        return userName;
    }

    public void setUserName(String userName)
    {
        this.userName = userName;
    }

    public String getTerminalSessionId(String url)
    {
        return terminalSessions.get(url);
    }

    public void setTerminalSessionId(String url, String srcSessionId)
    {
        terminalSessions.put(url, srcSessionId);
    }

    public String getRandomSequence()
    {
        return randomSequence;
    }

    public void setRandomSequence(String randomSequence)
    {
        this.randomSequence = randomSequence;
    }

    public List<String> getTerminalUriList()
    {
        if (null == terminalUriList)
        {
            terminalUriList = new ArrayList<String>();
        }
        return terminalUriList;
    }

    public void setTerminalUriList(List<String> terminalUriList)
    {
        this.terminalUriList = terminalUriList;
    }

    public byte[] getSecretKey()
    {
        if (null != secretKey)
        {
            return secretKey.clone();
        }
        else
        {
            return new byte[0];
        }
    }

    public void setSecretKey(byte[] secretKey)
    {
        if(null != secretKey)
        {
            this.secretKey = secretKey.clone();
        }
    }

    public byte[] getIv()
    {
        if (null != iv)
        {
            return iv.clone();
        }
        else
        {
            return new byte[0];
        }
    }

    public void setIv(byte[] iv)
    {
        if (null != iv)
        {
            this.iv = iv.clone();
        }
    }
}
